package com.dykj.fireFighting.api.base.maintenance.service;

import com.dykj.fireFighting.api.base.devHisResult.vo.ResultVo;
import com.dykj.fireFighting.api.base.maintenance.dto.MaintenanceStatisticsDto;
import com.dykj.fireFighting.api.base.maintenance.dto.UrgentMaintenanceDto;
import com.dykj.fireFighting.api.base.maintenance.entity.UrgentMaintenance;
import com.dykj.fireFighting.api.base.maintenance.vo.MaintenanceEvaluationVo;
import com.dykj.fireFighting.api.base.maintenance.vo.MaintenanceStatisticsVo;
import com.dykj.fireFighting.api.base.maintenance.vo.UrgentMaintenanceStatisticsVo;
import com.dykj.fireFighting.api.base.maintenance.vo.UrgentMaintenanceVo;
import com.dykj.fireFighting.common.core.service.IBaseService;
import com.dykj.fireFighting.common.core.vo.PageVo;

import java.math.BigDecimal;
import java.util.List;

/**
 * 紧急维保记录
 *
 * @Author JacksonTu
 * @Date 2021-07-28 08:38:40
 */
public interface IUrgentMaintenanceService extends IBaseService<UrgentMaintenance> {

    UrgentMaintenanceStatisticsVo getStatistics(String weibaoId);

    /**
     * 紧急维保记录-分页列表查询
     *
     * @param urgentMaintenanceDto
     * @return
     */
    PageVo<UrgentMaintenanceVo> queryUrgentMaintenanceList(UrgentMaintenanceDto urgentMaintenanceDto);

    /**
     * 获取紧急维保维修记录信息
     *
     * @param id
     * @return
     */
    UrgentMaintenanceVo getInfoById(String id);

    /**
     * 维保评价列表
     *
     * @param urgentMaintenanceDto
     * @return
     */
    PageVo<UrgentMaintenanceVo> queryEvaluationList(UrgentMaintenanceDto urgentMaintenanceDto);

    /**
     * 维保数据统计
     *
     * @param maintenanceStatisticsDto
     * @return
     */
    List<MaintenanceStatisticsVo> getMaintenanceStatistics(MaintenanceStatisticsDto maintenanceStatisticsDto);

    /**
     * 今日维保数据统计
     *
     * @param wbId
     * @return
     */
    List<Integer> getMaintenanceTodayStatistic(String wbId);

    /**
     * 待处理/紧急维保  统计
     *
     * @param wbId
     * @return
     */
    MaintenanceStatisticsVo getNotFinishedMaintenanceStatistics(String wbId);


    /**
     * 紧急维保记录分页列表
     *
     * @param urgentMaintenanceDto
     * @return
     */
    PageVo<UrgentMaintenanceVo> queryUrgentList(UrgentMaintenanceDto urgentMaintenanceDto);

    /**
     * @param id
     * @return
     */
    UrgentMaintenanceVo getUrgentMaintenanceInfoById(String id);

    /**
     * 维保服务机构的当月评价得分
     *
     * @param urgentMaintenanceDto
     * @return
     */
    List<MaintenanceEvaluationVo> queryMaintenanceEvaluationList(UrgentMaintenanceDto urgentMaintenanceDto);

    int getSociologyUrgentSocre(String start, String end, String socUnitId);

    /**
     * 维保机构当月评价得分的平均值
     *
     * @param urgentMaintenanceDto
     * @return
     */
    BigDecimal queryMaintenanceEvaluationAvg(UrgentMaintenanceDto urgentMaintenanceDto);

    /**
     * 获取监控中心下所有隐患数
     *
     * @param ids
     * @return
     */
    int getCenterNum(List<String> ids, String beginTime, String endTime);

    /**
     * 获取社会单位下所有隐患数
     *
     * @param id
     * @param beginTime
     * @param endTime
     * @return
     */
    int getUnitNum(String id, String beginTime, String endTime);

    /**
     * 维保机构当月所有被服务的社会单位评价得分的平均值
     *
     * @param unitId          监控中心
     * @param maintenanceDept 维保单位
     * @return
     */
    List<MaintenanceEvaluationVo> queryMaintenanceEvaluationAvgList(String unitId, String maintenanceDept, String date);


    int updateArriveTime(String id, String arriveTime);

    /**
     * 紧急维保 维保机构当月评价得分详情
     *
     * @param urgentMaintenanceDto
     * @return
     */
    List<UrgentMaintenanceVo> queryUrgentMaintenanceEvaluationInfoList(UrgentMaintenanceDto urgentMaintenanceDto);

    /**
     * 社会单位 获取 维保机构当月评价得分的平均值
     *
     * @param unitId
     * @return
     */
    List<MaintenanceEvaluationVo> queryMaintenanceEvaluationAvgListByUnit(String unitId);

    int getAllUnitByDay(List<String> ids, String begin, String end);

    List<ResultVo> getUnitByDay(String beginTime, String endTime, String unitId);

    List<ResultVo> getMonthByDate(String beginTime, String endTime, String unitId);

    List<ResultVo> getQuarterByDate(String beginTime, String endTime, String unitId);

    List<ResultVo> getYearByDate(String beginTime, String endTime, String unitId);

    List<ResultVo> getAllDay(String beginTime, String endTime, List<String> ids);

    List<ResultVo> getAllMonth(String beginTime, String endTime, List<String> ids);

    List<ResultVo> getAllQuarter(String beginTime, String endTime, List<String> ids);

    List<ResultVo> getAllYear(String beginTime, String endTime, List<String> ids);

    List<ResultVo> getRankByDate(String beginTime, String endTime, List<String> ids);

    List<ResultVo> getTrendEcharts(String beginTime, String endTime, List<String> ids);
}

